package com.peanut.youfupay.service.other.charge;


import com.alibaba.fastjson.JSON;
import com.peanut.youfupay.entity.charge.QueryAvailableRechargeAmtDTO;
import com.peanut.youfupay.entity.charge.QueryAvailableRechargeAmtResponseDTO;
import com.peanut.youfupay.entity.response.ResponseMessage;
import com.peanut.youfupay.enums.FunCodeEnum;
import com.peanut.youfupay.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 商户查询附属账户可充值金额
 *
 * @Author :  peanut
 */
@Slf4j
@Service("queryAvailableRechargeAmtServiceImpl")
public class QueryAvailableRechargeAmtServiceImpl extends BaseService {
    /**
     * @param funCodeEnum
     * @param queryAvailableRechargeAmtDTO
     * @return
     * @throws Exception
     */
    public QueryAvailableRechargeAmtResponseDTO doBusiness(FunCodeEnum funCodeEnum, QueryAvailableRechargeAmtDTO queryAvailableRechargeAmtDTO) throws Exception {
        log.info("查询可充值金额开始:{}，{}", funCodeEnum, queryAvailableRechargeAmtDTO);
        ResponseMessage responseMessage = applyYouFuByHttpPost(funCodeEnum, queryAvailableRechargeAmtDTO);
        QueryAvailableRechargeAmtResponseDTO queryAvailableRechargeAmtResponseDTO = JSON.parseObject(responseMessage.getResData(), QueryAvailableRechargeAmtResponseDTO.class);
        log.info("查询可充值金额结束:{}", queryAvailableRechargeAmtResponseDTO);
        return queryAvailableRechargeAmtResponseDTO;
    }

}
